home *** CD-ROM | disk | FTP | other *** search
/ Univers Interactif 3 / INTERACTIF.BIN / pc / planeten / internet / daemon10.sit / Daemon-100 / Daemon Documentation next >
Text File  |  1993-10-13  |  11KB  |  202 lines

  1. Daemon v1.0.1 ⌐ 1993 Peter N Lewis.
  2. This program is free for any use.
  3.  
  4. Ñ Contents
  5.  
  6.       What Daemon Does
  7.       What is Daemon
  8.       Using Daemon
  9.       The Services
  10.       Tokens
  11.       Example Plan and Whois File
  12.       Limitations
  13.       Small Print
  14.       Warranty
  15.       Fine Print
  16.       How It Works
  17.       Version History
  18.       Acknowledgements
  19.       The Author
  20.  
  21. Ñ What Daemon Does
  22.  
  23. Daemon is a general TCP server, implementing several simple unix daemons, namely Finger, Whois, Ident, Daytime and NTP (time).  It runs as a background only application, and answers queries to those services.
  24.  
  25. Ñ Using Daemon
  26.  
  27. Simply put an alias to Daemon into the Startup Items folder and launch it.  You will also need to write a Plan and Whois file as described under in The Services section.
  28.  
  29. Ñ The Services
  30.  
  31. Finger - The finger protocol allows people on the Internet to get information about a user.  The remote finger client sends the Mac a username, and Daemon returns information about that user.  This information often includes contact info (phone numbers, FAX numbers, etc), and info about when you will be available, prefered Email address, and of course the mandatory silly quotes :-).  You can specify what is to be returned by write a TEXT-only file, named "Plan" and putting it in the Preferences Folder in the System Folder.  As well as normal text, the file can contain "tokens" which let you put non-static information (such as the Idle time).  See the section on Tokens for more information.
  32.  
  33. Whois - The whois protocol is pretty much identical to the Finger protocol.  Its generally less personal, and more geared towards providing information (name, department, etc).  You specify the returned information by writing a TEXT-only file named "Whois" and putting it in the Preferences Folder in the System Folder.  The file can contain tokens in the same way as the Plan file.
  34.  
  35. Ident - The Ident protocol is intended to identify the user of a particular TCP connection on a multi-user machine.  Since the Mac is a single-user machine, all Daemon does is answer back with the Owner name of the Macintosh.
  36.  
  37. Daytime - The daytime protocol gives the local time in human readable form.  This is useful if someone wants to know what your time is to get an idea of when you are likely to be around.
  38.  
  39. NTP (time) - NTP gives the GMT time in binary form (not human readable, but machines love it).  It should be the same for all machines, but of course its not always exact.  It can be used in conjunction with Pete Resnick╒s NetTime to set the clocks of other Macintoshes.
  40.  
  41. Ñ Tokens
  42.  
  43. When Daemon interprets the Plan and Whois file, it looks for tokens and converts them into the information they specify.  Tokens stat with a % sign.  You can get a normal % sign by doubling it (%%), and you can hide a line break by ending the line with a % sign.
  44.  
  45. Here is a list of the tokens that Daemon understands, with examples of the information that replace the token.
  46.  
  47. %LOG
  48. %STARTUP-LONG     Thursday, 11 February 1993
  49. %STARTUP-SHORT    11/2/93
  50. %STARTUP-ABBREV   Thu, 11 Feb 1993
  51. %STARTUP-TIME     4:59
  52. %STARTUP-TIMESEC  4:59:56
  53. %CURRENT-LONG     Thursday, 11 February 1993
  54. %CURRENT-SHORT    11/2/93
  55. %CURRENT-ABBREV   Thu, 11 Feb 1993
  56. %CURRENT-TIME     16:50
  57. %CURRENT-TIMESEC  16:50:30
  58. %IDLE-TIME        0:03
  59. %IDLE-TIMESEC     0:03:15
  60. %TIMEON-TIME      11:50
  61. %TIMEON-TIMESEC   11:50:34
  62. %IDLEINWORDS     3 minutes 15 seconds
  63. %INPUT            Whoever
  64. %MACHINE          Rocky
  65. %OWNER            Peter
  66. %ICBM             N=-31.55' E=115.49'
  67. %GMT              8:00
  68. %MACENVY-APPLETALK       56
  69. %MACENVY-FPU             unknown
  70. %MACENVY-KEYBOARD        Extended ADB Keyboard
  71. %MACENVY-LOWMEMORY       8192
  72. %MACENVY-RAMSIZE         16M (010B7890)
  73. %MACENVY-LOGICALRAMSIZE  16M (010B7890)
  74. %MACENVY-MACHINE         Macintosh IIsi
  75. %MACENVY-ICON
  76. <ascii-art display of the icon>
  77. %MACENVY-MMU             68030 MMU
  78. %MACENVY-PAGESIZE        32768
  79. %MACENVY-CPU             68030
  80. %MACENVY-QUICKDRAW       2.3.0
  81. %MACENVY-REALRAMSIZE     17M (01100000)
  82. %MACENVY-PHYSICALRAMSIZE 17M (01100000)
  83. %MACENVY-ROMSIZE         512K (00080000)
  84. %MACENVY-ROM             067C
  85. %MACENVY-SLOTS           0
  86. %MACENVY-SOUND           Stereo sound with sound input
  87. %MACENVY-SYSTEM          7.0.1
  88. %MACENVY-TEXTEDIT        5
  89. %MACENVY-GESTALT         1
  90.  
  91. %IDLEINWORDS was written initially by Stuart Cheshire.
  92. %MACENVY was written initially by Quinn.
  93.  
  94. %FILE-:File
  95.       Returns the file (basically, it includes the File at this point).
  96.  
  97. %FILES-:Files
  98.       Returns the file in the specified folder named by the fingerer as the username.  The username may contain colons (:) to specify folders, but not two colons in a row, so they cannot go back up the folder tree to get at your whole file system (I hope not, anyway).  If the filename is blank, then filename @ will be used instead.  If the specified filename doesn't exist, the filename ? will be used instead. 
  99.  
  100. %LOOKUP-:Lookup
  101.       This will scan the specified file and return any lines containg the words in the fingered name.  You could use this to provide a primitive information server (such as an Email or price data base).
  102.  
  103. %FORTUNE-:Fortune
  104.       Returns a randomly selected fortune from the specified folder.  The format of the fortune file is a sequence of fortunes seperated by a line containing only a hash (#) character.  The file must end with a hash character followed by a return.  For example
  105.  
  106. Fortune line 1
  107. #
  108. Fortune line 2
  109. a two line fortune
  110. #
  111.  
  112. Remember to format your fortunes, files, and the Plan file for an 80 column screen.  Also, the files specified in the %FORTUNE, %FILES and %LOOKUP tokens can themselves contain tokens, so you can create quite complex plans.
  113.  
  114. BTW (By the way), in the last four tokens I have used files in the Preferences folder in the System Folder as examples.  You don't have to restrict yourself to this folder, you could for example use the token %FORTUNE-HardDisk:FortuneFile to specify that the fortune file was named FortuneFile and could be found in the root folder of the hard disk named HardDisk, or to make your entire hard disk named FreeAccess visible on the internet you could put %FILES-FreeAccess.  WARNING: %FILES is a serious security risk, so only use it if you are sure you want to make all files in the specified folder and all its sub-folders visible to the entire networld!
  115.  
  116. Ñ Example Plan and Whois Files
  117.  
  118. Since there is only one user on a Mac, you can have a very simple Plan or Whois file like this:
  119.  
  120. *****
  121. %OWNER has been on %MACENVY-MACHINE since %STARTUP-TIME, %STARTUP-ABBREV.  
  122. Idle %IDLE-TIMESEC.  Current time is %CURRENT-TIME, %CURRENT-ABBREV
  123.  
  124. At work:     Computer Systems Officer, NCRPDA, Curtin University,
  125.              GPO Box U1987, Perth WA 6001, AUSTRALIA.
  126. Phone:       +61 9 345 6789
  127. After Hours: Mac Programmer/Hacker (in the traditional sense of the word).
  128. *****
  129.  
  130. But you may have more than one user on the Mac, or you may want to pretend you do.  So make a directory in the Preferences Folder "Files", and then make the Plan file:
  131.  
  132. *****
  133. %FILES-:Files
  134. *****
  135.  
  136. Now in the Files folder, put the follwing files:
  137. Peter - containing the Finger/Whois information for Peter
  138. Fred - ditto for Fred
  139. @ - the information for when they finger "everyone" (ie, finger @your.mac)
  140. ? - the information for when they finger someone invalid (ie, finger womble@your.mac)
  141.  
  142. Ñ Limitations
  143.  
  144. Daemon requires MacTCP 1.1 and probably requires the 128k ROM (or later).
  145.  
  146. Ñ Small Print
  147.  
  148. This program is Free.  You can use it anywhere you want, you can do anything you like with it.
  149.  
  150. Ñ Warranty
  151.  
  152. While I have made every attempt at making this program work correctly, I cannot guarentee it will work.  If it doesn╒t work, I╒ll refund your money :-)
  153.  
  154. Ñ Fine Print
  155.  
  156. Peter Lewis hereby disclaims all warranties relating to this software, whether express or implied, including without limitation any implied warranties of merchantability or fitness for a particular purpose.  Peter Lewis will not be liable for any special, incidental, consequential, indirect or similar damages due to loss of data or any other reason, even if Peter Lewis or an agent of his has been advised of the possibility of such damages.  In no event shall Peter Lewis be liable for any damages, regardless of the form of the claim.  The person using the software bears all risk as to the quality and performance of the software.
  157.  
  158. Ñ How It Works
  159.  
  160. Daemon starts up and looks at all the TEXT resources contained within its resource fork.  For each resource, it spawns two identical tasks (using the Task Manager package written by Michael Hecht), that listen to port ID-10000 (where ID is the ID of the TEXT resource).  When a connection is made on that port, it reads a line (unless the resource name starts with a + or -), and then sends the resource back after converting the tokens (only one if the name starts with a +).  If the name doesn't start with a +, it also convers <cr> to <crlf>, and translates Mac 8-bit characters to ISO standard characters.
  161.  
  162. Ñ Version History
  163.  
  164. Still to do -
  165.  
  166. 1.0.1
  167.  
  168. Ñ The Author
  169.  
  170. Programs written by me:
  171. DeHQX 2.0.1 - BinHex decoder (use StuffIt Expander instead).
  172. Finger 1.3.7 - Macintosh Finger client/daemon.
  173. Daemon 1.0.0 - Macintosh multi-protocol daemon.
  174. Talk 1.1.1 - Macintosh Talk client/daemon.
  175. Chat 1.1.0 - Multiuser primitive irc-like daemon.
  176. FTPd 2.1.0 - Macintosh FTP server.
  177. Anarchie 1.0.0 - Macintosh archie client.
  178. Script Daemon 1.0.0 - Telnet->AppleScript gateway
  179. ObiWan 4.0.1 - Online help system.
  180. MacBinary II+ 1.0.2 - MacBinary II+ encoder/decoder.
  181. FetchNews 1.0.0b - Fetch News for use with NewsWatcher╒s demo mode.
  182. MacTCP Watcher 1.1.0 - Display MacTCP╒s state information.
  183. Bolo Finder 1.0.2 - Display the results from Mike Ellis' Bolo Tracker.
  184. Bolo RandomMap 1.1.0 - Generate a random map for Bolo.
  185.  
  186. French versions of some of my programs may be available from ftp.sri.ucl.ac.be:/pub.
  187.  
  188. You can sometimes get the latest development versions from redback.cs.uwa.edu.au:/others/peterlewis, but please use the major archives for released version if at all possible.  Redback is a long long way from most people, and using it wastes bandwidth on the Australian-US satelite link which is overly congested already.  So use the versions posted to the archives (like sumex-aim.stanford.edu or mac.archive.umich.edu), and only use the development versions if you have some specific problem - in which case tell me, especially since the development versions on redback are often not the latest versions I have)
  189.  
  190. Send postcards, comments, bug reports, wishes, and payments to:
  191.  
  192. Peter Lewis,
  193. 10 Earlston Way,
  194. Booragoon, Perth, WA, 6154,
  195. AUSTRALIA
  196.  
  197. or by electronic mail to:
  198.  
  199. Internet: peter.lewis@info.curtin.edu.au
  200. Bitnet: peter.lewis%info.curtin.edu.au@cunyvm.bitnet
  201. UUCP: uunet!munnari.oz!info.curtin.edu.au!peter.lewis
  202.